<%@ include file="../common/top.jsp"%>
<%--修改登录页面--%>
<div class="w panel">
  <div id="Catalog">
    <form action="verify" method="post" name="form1" id="LoginForm">
      <p align="center" id="Title">MyStore</p>
      <c:if test="${requestScope.signOnMsg != null}">
        <p><font color="red">${requestScope.signOnMsg} </font></p>
      </c:if>
      <p>
      <div id="Login">
        <div class="LoginInput">
          <div class="LoginText">Account:</div>
          <input type="text" class="UserInputs" name="username"><br/>
        </div>
        <div class="LoginInput">
          <div class="LoginText"> Password:</div>
          <input type="password" class="UserInputs" name="password"><br/></div>
        <div class="LoginInput">
          <div class="LoginText">Captcha:</div>
          <input id="code_input" class="UserInputsShort" type="captcha" name="captcha">
          <div id="v_container" class="UserInputsShort"></div>
          <br/>
        </div>
        <div id="LoginButtonContainer">
          <div style="text-align: center;">
            <input id="my_button" type="button" value="Login" style="text-align: center;">
          </div>
        </div>
      </div>
      <%--    </form>--%>

      <script>
        let verifyCode = new GVerify("v_container");

        let test = ""
        document.getElementById("my_button").onclick = function () {
          let res = verifyCode.validate(document.getElementById("code_input").value);
          if (res) {
            alert("verify success!");
            document.form1.submit();
          } else {
            alert("verify failed");
          }
        }
      </script>
    </form>
    <div style="text-align: center;">
      Need a username and password?
      <a href="registerForm">Register Now!</a>
    </div>

  </div>
</div>
<%@ include file="../common/bottom.jsp"%>